import request from "@/services/request";
const prefix = `${import.meta.env.VITE_API_PREFIX}`;

// 新增
export function postObj(data: any) {
  return request({
    url: `${prefix}/devops/projectapi`,
    method: "POST",
    data,
  });
}

// 删除
export function deleteObj(id: number) {
  return request({
    url: `${prefix}/devops/projectapi/${id}`,
    method: "DELETE",
  });
}

// 修改
export function putObj(data: any) {
  return request({
    url: `${prefix}/devops/projectapi/${data.id}`,
    method: "PUT",
    data,
  });
}

// 查询
export function getObj(id: number) {
  return request({
    url: `${prefix}/devops/projectapi/${id}`,
    method: "GET",
  });
}

// 列表
export function getList(params: any) {
  return request({
    url: `${prefix}/devops/projectapi`,
    method: "GET",
    params,
  });
}

// 分页
export function getPage(params: any) {
  return request({
    url: `${prefix}/devops/projectapi`,
    method: "GET",
    params,
  });
}
